<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\MallOrderListSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Mall Order Lists';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="mall-order-list-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Mall Order List', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
//        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            //'mid',
            //'pid',
            [
                'label' => '产品名',
                'attribute' => 'product.title',
            ],
            [
                'label' => '点击查看',
                'format' => 'raw',
                'value' => function ($model) {
                    return Html::a('查看详情', ['mall-product/index', 'MallProductSearch[id]' => $model->pid], ['class' => '']);
                }
            ],
            //'out_trade_no',
            [
                'attribute' => 'out_trade_no',
                'enableSorting' => false
            ],
            //'logistic',
            //'price',
            //'count',
            [
                'attribute' => 'count',
                'enableSorting' => false
            ],
            //'create_time:datetime',
            //'total_fee',
            //'uid',
            //'sku_id',
            //'amount',
            //'level_one',
            //'level_two',
            //'product_no',
            //'value',
            [
                'attribute' => 'value',
                'enableSorting' => false
            ],

            //['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
